﻿using System;
using System.Windows;

namespace CardPlay.Client.Tools
{
    public sealed class InputEvent
    {
        public const string MouseMove = "MouseMove";
        public const string MouseEnter = "MouseEnter";
        public const string MouseLeave = "MouseLeave";
        public const string MouseLeftButtonDown = "MouseLeftButtonDown";
        public const string MouseLeftButtonUp = "MouseLeftButtonUp";
        public const string MouseRightButtonDown = "MouseRightButtonDown";
        public const string MouseRightButtonUp = "MouseRightButtonUp";
        public const string KeyDown = "KeyDown";
        public const string KeyUp = "KeyUp";
        public const string LostMouseCapture = "LostMouseCapture";

        public InputEvent(object source, string name, RoutedEventArgs args)
        {
            Source = source;
            Name = name;
            Args = args;
        }

        public object Source { get; private set; }

        public string Name { get; private set; }
        
        public RoutedEventArgs Args { get; private set; }

        public UIElement InputElement
        {
            get
            {
                return Source as UIElement;
            }
        }

        public override string ToString()
        {
            return String.Format("{0} - {1}", Name, Args);
        }
    }
}
